<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>

</head>
<body>

<div id ="test"><a href="//www.microsoft.com">Microsoft</a></div>

<input type="button" onclick="changeLink()" value="修改链接">

<script>
    var cc= ['超市','商场','农贸市场']


    function changeLink(){

        var html =""
        for(var i=0;i<cc.length;i++){
//            html.push('"<a>"+cc[i]+"</a>"')
            html += '<a>'+cc[i]+'</a>'

        }

            document.getElementById('test').innerHTML=html;



    }
</script>
</body>
</html>